﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmitMapper;

namespace CHPM.IC.ObjectMapper
{
    public class EmitObjectMapper : IObjectMapper
    {
        #region Fields

        private readonly ObjectMapperManager _objectMapperManager;

        #endregion

        #region Constructors

        public EmitObjectMapper()
        {
            this._objectMapperManager = ObjectMapperManager.DefaultInstance;
        }

        #endregion

        #region IObjectMapper Members

        public TResult Map<TSource, TResult>(TSource source)
        {
            return this._objectMapperManager.GetMapper<TSource, TResult>().Map(source);
        }

        #endregion
    }
}
